package org.apache.flink.runtime.highavailability;

import org.apache.flink.api.common.ConsumerID;
import org.apache.flink.runtime.resourceconsumer.ConsumeResult;
import org.apache.flink.util.Preconditions;

/**
 * {@code ConsumeResultEntry} is the entity managed by the {@link ConsumeResultStore}. It collects
 * information about a globally terminated job (e.g. {@link ConsumeResult}).
 */
public class ConsumeResultEntry {

    private final ConsumeResult jobResult;

    public ConsumeResultEntry(ConsumeResult jobResult) {
        this.jobResult = Preconditions.checkNotNull(jobResult);
    }

    public ConsumeResult getJobResult() {
        return jobResult;
    }

    public ConsumerID getJobId() {
        return jobResult.getJobId();
    }
}
